import service from '@/utils/request'

// @Tags Episode
// @Summary 创建episode剧集
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Episode true "创建episode剧集"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /episode/createEpisode [post]
export const createEpisode = (data) => {
  return service({
    url: '/episode/createEpisode',
    method: 'post',
    data
  })
}

// @Tags Episode
// @Summary 删除episode剧集
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Episode true "删除episode剧集"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /episode/deleteEpisode [delete]
export const deleteEpisode = (data) => {
  return service({
    url: '/episode/deleteEpisode',
    method: 'delete',
    data
  })
}

// @Tags Episode
// @Summary 批量删除episode剧集
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除episode剧集"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /episode/deleteEpisode [delete]
export const deleteEpisodeByIds = (data) => {
  return service({
    url: '/episode/deleteEpisodeByIds',
    method: 'delete',
    data
  })
}

// @Tags Episode
// @Summary 更新episode剧集
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Episode true "更新episode剧集"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /episode/updateEpisode [put]
export const updateEpisode = (data) => {
  return service({
    url: '/episode/updateEpisode',
    method: 'put',
    data
  })
}

// @Tags Episode
// @Summary 用id查询episode剧集
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query model.Episode true "用id查询episode剧集"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /episode/findEpisode [get]
export const findEpisode = (params) => {
  return service({
    url: '/episode/findEpisode',
    method: 'get',
    params
  })
}

// @Tags Episode
// @Summary 分页获取episode剧集列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query request.PageInfo true "分页获取episode剧集列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /episode/getEpisodeList [get]
export const getEpisodeList = (params) => {
  return service({
    url: '/episode/getEpisodeList',
    method: 'get',
    params
  })
}


export const refreshEpisodeByIds = (data) => {
  return service({
    url: '/tReferral/refreshTReferralByIds',
    method: 'post',
    data
  })
}

export const createMultiEpisode= (data) => {
  return service({
    url: '/episode/createMultiEpisode',
    method: 'post',
    data
  })
}


export const updateSyncEpisode = (data) => {
  return service({
    url: '/episode/updateSyncEpisode',
    method: 'put',
    data
  })
}